package com.gym.client;

import com.alibaba.fastjson.JSONObject;
import com.gym.pojo.Catsaletake;
import com.gym.pojo.Cattype;
import com.gym.pojo.User;
import com.gym.vo.Caum;
import com.gym.vo.UserVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

@FeignClient(name = "gateway",path = "/userprovider",contextId = "memberprovider")
public interface MemberClient {

    @RequestMapping("/listMem")
    public List<UserVo> listMem(@RequestParam(name = "name")String name,
                                @RequestParam(name = "catId") Integer catId);

    @RequestMapping("/selListMember")
    public JSONObject selMember(@RequestParam(name = "name")String name,
                                @RequestParam(name = "catId")Integer catId,
                                @RequestParam(name = "index")int index,
                                @RequestParam(name = "size")int size);

    @RequestMapping("/expireMem")
    public List<UserVo> expireMem(@RequestParam(name = "date")String date,
                                  @RequestParam(name = "time")String time);

    @RequestMapping("/updMemStatic")
    public boolean updMemStatic(@RequestParam(name = "memId")int memId);

    @RequestMapping("/listCat")
    public List<Cattype> listCat(@RequestParam(name = "name")String name);

    @RequestMapping("/delCatById")
    public boolean delCatById(@RequestParam(name = "catId")int catId);

    @RequestMapping("/selCatByMem")
    public boolean selCatByMem(@RequestParam(name = "catId")int catId);

    @RequestMapping("/updCatById")
    public boolean updCatById(@RequestBody Cattype cat);

    @RequestMapping("/insCat")
    public boolean insCat(@RequestBody Cattype cat);

    @RequestMapping("/insertMem")
    public boolean inMem(@RequestBody Caum caum);

    @RequestMapping("/insCatSaleTake")
    public boolean insCatSaleTake(@RequestBody Catsaletake cst);
    @RequestMapping("/selCatSelaTake")
    public JSONObject selCatSelaTake(@RequestParam(name = "date")String date,
                                     @RequestParam(name = "time")String time,
                                     @RequestParam(name = "index")int index,
                                     @RequestParam(name = "size")int size);

    @RequestMapping("/selUserById")
    public UserVo selUserById(@RequestParam(name = "userId")int userId);

    @RequestMapping("/continuous")
    public boolean continuous(@RequestBody Caum caum);
}